import requests
import uncurl


class __clear_time__:

    def __query_uncurl__(self):
        curl_command = '''
     curl 'http://10.10.80.215:9089/api/centralfault/inf/syncAlarm/front?sheetId=XZ-122-241112-00029' \
  -H 'Accept: application/json' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://10.10.80.215:9089/form-manage/proc-ins-manage/process-manage/new-process/pendingList' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' \
  -H 'combine-token: 3dc4adef-5ffd-499d-a6a3-0ac674c75a76,891f3347-1fbe-4595-b089-a874a29f43da' \
  --insecure
      '''

        req = uncurl.parse_context(curl_command)

        response = requests.request(
            method=req.method,
            url=req.url,
            headers=req.headers,
            data=req.data,
            verify=False
        )

        print(response.json())


def __query_uncurl_commit__(self):
    curl_command = '''
    curl 'http://10.10.80.215:9089/eServer/centralFault/commitTask?form_inst_id=8939&ins_proc_id=6279&ins_node_id=23163&proc_id=122&node_id=20&assignOrganize=&decision=8&assignUserId=' \
  -H 'Accept: application/json' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H $'Cookie: \'\'; \'\'=\'\'' \
  -H 'Origin: http://10.10.80.215:9089' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://10.10.80.215:9089/form-manage/proc-ins-manage/process-manage/new-process/pendingList' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' \
  -H 'combine-token: ed338b09-056e-4eed-8bb4-d7d55ab8f45c,27528fbd-9dad-4967-8b62-6c62b83234e2' \
  --data-raw '[{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"eaabe55c-b56b-4c51-a61e-631f869705e2","itemKey":"operationUser","seqId":0,"seqName":"操作信息","data":"rjp"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"447bab3e-7753-4927-962a-fe8246790377","itemKey":"department","seqId":0,"seqName":"操作信息","data":"西藏自治区移动公司"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"bab09898-a3a9-4ead-b94b-f2f7a6caf361","itemKey":"role","seqId":0,"seqName":"操作信息","data":"林芝察隅县传输维护班组"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"223b819f-3793-436c-a954-1a8936c9bdfa","itemKey":"telephone","seqId":0,"seqName":"操作信息","data":"19768903234"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"f71f4579-f43d-4e37-9577-e756961298a3","itemKey":"sendTime","seqId":0,"seqName":"操作信息","data":"2024-11-12 15:39:22"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"893f72f5-6de6-42df-8975-95bea9f0a09f","itemKey":"sheetId","seqId":0,"seqName":"告警清除时间","data":"XZ-122-241112-00029"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"83a52499-0109-4abb-89a2-b5b1ddf12850","itemKey":"alarmClearedTime","seqId":0,"seqName":"告警清除时间","data":"2024-11-12 01:23:44"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"eb013d43-adad-44a9-83d8-84aff60363cd","itemKey":"isMajorFault","seqId":0,"seqName":"处理信息","data":"{\"label\":\"是\",\"value\":\"f9bb7cf0-fa68-444e-b9ce-e2f5ea88c99e\",\"key\":\"f9bb7cf0-fa68-444e-b9ce-e2f5ea88c99e\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"2cc911d8-a455-44a7-9d3c-a53979eeca23","itemKey":"isSiteOperation","seqId":0,"seqName":"处理信息","data":"{\"label\":\"是\",\"value\":\"5c47e16d-d3e6-4ab8-a3ac-ac7cdab3adf4\",\"key\":\"5c47e16d-d3e6-4ab8-a3ac-ac7cdab3adf4\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"9515bbea-e380-4de0-b0d4-7a8a1d4620e1","itemKey":"faultReasonSort","seqId":0,"seqName":"处理信息","data":"{\"label\":\"数据网\",\"value\":\"104010405\",\"key\":\"104010405\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"fd41e38c-4390-4bbf-bd12-ed4baa5be766","itemKey":"faultReasonSubSort","seqId":0,"seqName":"处理信息","data":"{\"label\":\"网管\",\"value\":\"10401040508\",\"key\":\"10401040508\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"110321fc-f663-4404-b4d8-e52b8997b102","itemKey":"faultReasonSubSort2","seqId":0,"seqName":"处理信息","data":"{\"label\":\"其他\",\"value\":\"1040104050802\",\"key\":\"1040104050802\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"b5379dee-68f2-45ea-97b4-e0ede5c52659","itemKey":"faultReasonSubSort3","seqId":0,"seqName":"处理信息","data":"{\"label\":\"其他\",\"value\":\"104010405080201\",\"key\":\"104010405080201\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"54c16190-5974-471a-bdda-d3bbbf40f7e5","itemKey":"treatmentMeasure","seqId":0,"seqName":"处理信息","data":"{\"label\":\"其他\",\"value\":\"10401040508020101\",\"key\":\"10401040508020101\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"d9faad8e-0308-4285-b5ed-55694a74ca8c","itemKey":"regionAttribute","seqId":0,"seqName":"处理信息","data":"{\"label\":\"城市\",\"value\":\"0\",\"key\":\"0\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"23d8f942-bc17-4aae-95f1-5c596b97d851","itemKey":"isAffectBusiness","seqId":0,"seqName":"处理信息","data":"{\"label\":\"是\",\"value\":\"1\",\"key\":\"1\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"a7a883b7-eca2-4837-b3d2-55d9a7ffb915","itemKey":"businessRecoverTime","seqId":0,"seqName":"处理信息","data":"2024-11-15 16:35:12"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"a155de93-0c0e-478c-9390-282c4f64fb23","itemKey":"isVerifiedMalfunction","seqId":0,"seqName":"处理信息","data":"{\"label\":\"是\",\"value\":\"1\",\"key\":\"1\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"facaec48-8e59-4762-adb1-bd19eaa4767e","itemKey":"faultDealResult","seqId":0,"seqName":"处理信息","data":"{\"label\":\"无需解决\",\"value\":\"4ce32035-d3b6-4174-bd88-cda237c326ab\",\"key\":\"4ce32035-d3b6-4174-bd88-cda237c326ab\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"0c7f8a38-80a6-4e12-a584-1ad1235e2e11","itemKey":"isManualCleartime","seqId":0,"seqName":"处理信息","data":"1"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"792acb9b-71cf-42a7-a7c1-0454b840f4ae","itemKey":"treatmentMeasureSupplement","seqId":0,"seqName":"处理信息","data":"fdfdf"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"f8e37040-d865-4452-b81a-4af4ca57eb93","itemKey":"handlingMeasures","seqId":0,"seqName":"处理信息","data":"其他"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"1647b92f-bb83-4eb0-af02-b9544e57c1a0","itemKey":"isHasTrouble","seqId":0,"seqName":"处理信息","data":"{\"label\":\"否\",\"value\":\"0\",\"key\":\"0\"}"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"fd596064-bfed-47f7-b338-ba2d6972a2f8","itemKey":"acceptLimit","seqId":0,"seqName":"处理信息","data":"2024-11-12 16:01:22"},{"formInstId":8939,"insProcId":"6279","insNodeId":"23163","itemId":"a63355aa-8e6c-4abb-bf31-70802da450e7","itemKey":"businessAffectExplain","seqId":0,"seqName":"处理信息","data":"gd"},{"insProcId":"6279","insNodeId":"23163","itemId":"showCondition","itemKey":"showCondition","seqId":0,"data":"8"}]'
      '''

    req = uncurl.parse_context(curl_command)

    response = requests.request(
        method=req.method,
        url=req.url,
        headers=req.headers,
        data=req.data,
        verify=False
    )

    print(response.json())
